package com.ecr.hub.service.data.input.xls;

import com.ecr.hub.model.enumeration.HubTypeFile;

public interface IXlsDecoder {

	// Indicateur chargé/vide dans TCMS.
	public static final String INDICATOR_LOADED = "LOADED";
	public static final String INDICATOR_EMPTY = "EMPTY";

	// Les nom des fichiers.
	public static final String FILE_PREFIX_SILLONS = "sillons";
	public static final String FILE_PREFIX_COMPOSITIONS = "compositions";

	// L'extension Excel.
	public static final String EXCEL_SUFFIX = ".xls";

	// Le séparateur pour pouvoir retrouver la destination dans le flow
	// description.
	public static final String DESTINATION_EXT_ID_SEPARATOR = "-";

	// Vérification de certains formats.
	public static final String REGEX_WAGON = "^[0-9]{12}$";
	public static final String REGEX_TIME = "^([0-1][0-9]|2[0-3]):([0-5][0-9])$";

	/*
	 * -------- SILLON --------
	 */
	public static final int START_LINE_SILLON = 4;

	public static final int SILLON_COLUMN_DEP_DATE = 1;
	public static final int SILLON_COLUMN_SILLON_ID = 2;
	public static final int SILLON_COLUMN_TCMS_TRAIN_ID = 3;
	public static final int SILLON_COLUMN_ORIGIN = 4;
	public static final int SILLON_COLUMN_DESTINATION = 5;
	public static final int SILLON_COLUMN_DEP_TIME = 6;
	public static final int SILLON_COLUMN_ACT_DEP_TIME = 7;
	public static final int SILLON_COLUMN_ARR_DATE = 8;
	public static final int SILLON_COLUMN_ARR_TIME = 9;
	public static final int SILLON_COLUMN_ACT_ARR_TIME = 10;
	public static final int SILLON_COLUMN_WAGON_CONVEYED = 11;
	public static final int SILLON_COLUMN_TONNES = 12;
	public static final int SILLON_COLUMN_CUSTOMER = 13;
	public static final int SILLON_COLUMN_CANCELLATION = 14;
	public static final int SILLON_COLUMN_DELAY_REASONS = 15;

	public static final String HUB_STATION = "ACHERES";
	public static final String SILLON_BAD_TCMS_TRAIN_ID = "DRAFT,RECO LIGNE,SILLON RESERVE";
	public static final String CANCELLED = "ANNULÉ";
	public static final String ECR_CUSTOMER = "ECR";

	/*
	 * -------- COMPOSITION --------
	 */
	public static final int COMPOSITION_LINE_TCMS_TRAIN_ID = 1;
	public static final int COMPOSITION_LINE_TITLE = 10;
	public static final int COMPOSITION_COLUMN_TCMS_TRAIN_ID = 12;
	public static final int COMPOSITION_LINE_SILLON_EXT_ID = 11;
	public static final int COMPOSITION_COLUMN_SILLON_EXT_ID = 1;
	public static final int COMPOSITION_LINE_DATE_SILLON = 5;
	public static final int COMPOSITION_COLUMN_DATE_SILLON = 2;
	public static final int COMPOSITION_COLUMN_ID = 1;
	public static final int COMPOSITION_COLUMN_TYPE = 2;
	public static final int COMPOSITION_COLUMN_LADING = 3;
	public static final int COMPOSITION_COLUMN_CLASS = 4;
	public static final int COMPOSITION_COLUMN_TAG = 5;
	public static final int COMPOSITION_COLUMN_DEST = 6;
	public static final int COMPOSITION_COLUMN_ORIGIN = 7;
	public static final int COMPOSITION_COLUMN_COMM = 8;
	public static final int COMPOSITION_COLUMN_COMM_DESC = 9;
	public static final int COMPOSITION_COLUMN_DG = 10;
	public static final int COMPOSITION_COLUMN_CONSIGNEE = 11;
	public static final int COMPOSITION_COLUMN_W_EXAM = 12;
	public static final int COMPOSITION_COLUMN_CRIPPLE = 13;
	public static final int COMPOSITION_COLUMN_SPEED = 14;
	public static final int COMPOSITION_COLUMN_RA = 15;
	public static final int COMPOSITION_COLUMN_LENGTH = 16;
	public static final int COMPOSITION_COLUMN_G_WEIGHT = 17;
	public static final int COMPOSITION_COLUMN_N_WEIGHT = 18;
	public static final int COMPOSITION_COLUMN_FLOW_DESCRIPTION = 19;
	public static final int COMPOSITION_COLUMN_ATE = 20;
	public static final int COMPOSITION_COLUMN_BRAKE_FORCE = 21;

	public void decodeXls();

	public String getStoreFileNameXls(HubTypeFile typeFile);
}
